/* 防抖 (debounce) */
function debounce(fn, wait) {
  let timeout;
  return (...param) => {
    if (timeout) clearTimeout(timeout);
    timeout = setTimeout(() => {
      fn(...param);
    }, wait);
  };
}

export default debounce;
